let express = require('express');
let user = require('../service/user');
let activity = require('../service/activity');
let ac = require('../service/ac');
let wx = require('../service/wxpay');
let manager = require('../service/manager');
let bmfw = require('../service/bmfw');
let subject = require('../routes/ws');
let szyx = require('../service/szyx');
let rcode = require('../service/rcode');
let msocket = require('../service/msocket');
let router = express.Router();

//用户路由
router.post('/register', user.register);
router.post('/login', user.login);
router.post('/smsSend', user.smsSend);
//活动路由
router.post('/activity_add', activity.add);
router.post('/activity_find', activity.find);
router.post('/activity_delete', activity.delete);
//查询本次活动结果
router.post('/activity_findThisResult', activity.findThisResult);
//查询活动列表
router.post('/activity_findList', activity.findList);

//创建整体活动
router.post('/ac_add', ac.add);
router.post('/ac_findList', ac.findList);
router.post('/ac_findActivityList', ac.findActivityList);
router.post('/ac_findResultList', ac.findResultList);
router.post('/ac_findUserTopicList', ac.findUserTopicList);
router.post('/ac_findUserResultType', ac.findUserResultType);
router.post('/ac_getActivityTime', ac.getActivityTime);
router.post('/ac_findDPResultList', ac.findDPResultList);
//题目操作
router.post('/activity_start', msocket.start);
router.post('/activity_end', msocket.end);
router.all('/activity_getActivityTime', msocket.getActivityTime);
router.all('/activ_addUser', msocket.addUser);
router.all('/activ_queryTribeUser', msocket.queryTribeUser);
router.all('/activ_addTribeUser', msocket.addTribeUser);

//管理员
router.post('/manager_login', manager.login);
router.post('/manager_logins', manager.logins);
router.post('/manager_tableTotal', manager.tableTotal);
router.post('/manager_table1', manager.table1);
router.post('/manager_table2', manager.table2);
router.post('/manager_table3', manager.table3);
router.post('/manager_table4', manager.table4);

//导出
router.post('/manager_exportData1', manager.exportData1);
router.post('/manager_exportData2', manager.exportData2);
router.post('/manager_exportData3', manager.exportData3);
router.post('/manager_exportData4', manager.exportData4);

//微信小程序
router.get('/wx_getOpendId', wx.getOpendId);
router.post('/wx_order', wx.order);

//便民服务
router.all('/bmfw/*', bmfw.bmfw);
router.all('/getWXuserinfo', user.getWXuserinfo);

/*------------------生成活动码----------------------*/
router.all('/getrcode', rcode.getrcode);
router.all('/getscreendata', user.dscreen);
/*----------------------------------------*/

// 申报
router.all('/declare', user.declare);
router.all('/ac_delete', user.ac_delete);
router.all('/findUser', user.findUser);
router.all('/findArea', user.findArea);
router.all('/findDealer', ac.findDealer);
router.all('/ac_edit', ac.edit);




router.all('/ac_findUserResults', ac.findUserResults);
router.all('/ac_findLSResults', ac.findLSResults);

module.exports = router;